package asTest;

import A经典面试.TestString;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;

public class Test01 extends TestString {


    public static void main(String[] args) {
        SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.add(Calendar.MONTH, -1);
        Date nextTime = calendar.getTime();
        String nextMonth = format.format(nextTime);
        System.out.println(nextMonth);


        System.out.println("---------------------");
        String a = "0123456789";
        System.out.println(a.substring(0,8));
        System.out.println("==================================================");

        String idNo = "42052819980318381x";
        String newIdNo = idNo.replaceAll("[^a-zA-Z0-9]","");
        System.out.println(newIdNo);

        String aa = new String("ab43a2c43d");
        System.out.println(aa.replaceAll("\\d","ff"));

        ConcurrentHashMap<String,Object> map = new ConcurrentHashMap<>();
        map.put("1",'a');
        map.put("2","");
        map.put("3","aaa");
        for (String key: map.keySet()){
            System.out.println(map.get(key));
        }





    }
}
